Macro FCInfo/ru

Macro FCInfo

Description
Предоставляет информацию о выбранной форме и может отображать преобразование длины, наклона (градусы, радианы, уклоны, процент), площади, объема и веса в различных единицах (метрических и британских). Теперь макрос также работает для элементов эскиза в режиме редактирования.


Французская Версия Version française

Macro version: 1.26c
Last modified: 2022/04/19
FreeCAD version: All
Author: Mario52

Author
Mario52
Download
None
Links
Macro Version
1.26c
Date last modified
2022/04/19
FreeCAD Version(s)
All
Default shortcut
None
See also
Arch Survey Arch Survey
Macro_SimpleProperties Macro SimpleProperties
Macro FCInfoGlass

Описание

Предоставляет информацию о выбранной форме и может отображать преобразование длины, наклона (градусы, радианы, уклоны, процент), площади, объёма и веса в различных единицах (метрических и британских). Теперь макрос также работает для элементов эскиза в режиме редактирования.

Temporary code for external macro link. Do not use this code. This code is used exclusively by Addon Manager. Link for optional manual installation: Macro


# This code is copied instead of the original macro code
# to guide the user to the online download page.
# Use it if the code of the macro is larger than 64 KB and cannot be included in the wiki
# or if the RAW code URL is somewhere else in the wiki.

from PySide import QtGui, QtCore

diag = QtGui.QMessageBox(QtGui.QMessageBox.Information,
    "Information",
    "This macro must be downloaded from this link\n"
    "\n"
    "https://gist.githubusercontent.com/mario52a/8d40ab6c018c2bde678f/raw/2ba412bef3a9a5a0c6da4f3be18513a585f3a301/FCInfo_en_Ver_1-30c-rmu_Docked.FCMacro" + "\n"
    "\n"
    "Quit this window to access the download page")

diag.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint)
diag.setWindowModality(QtCore.Qt.ApplicationModal)
diag.exec_()

import webbrowser 
webbrowser.open("https://gist.githubusercontent.com/mario52a/8d40ab6c018c2bde678f/raw/2ba412bef3a9a5a0c6da4f3be18513a585f3a301/FCInfo_en_Ver_1-30c-rmu_Docked.FCMacro")
<class="rawcodeurl"><a href="https://gist.githubusercontent.com/mario52a/8d40ab6c018c2bde678f/raw/2ba412bef3a9a5a0c6da4f3be18513a585f3a301/FCInfo_en_Ver_1-30c-rmu_Docked.FCMacro">raw code</a>


FCInfo

Usage

Выберите объект или запустите приложение и выберите объект, после чего появится ряд сведений. Его расчеты основаны на единице измерения FreeCAD, которой является мм при каждом новом выделении, единица длины всегда указывается в мм, а угол - в десятичных градусах.

upper window
upper window
lower window

Сектор 1: Документ

  • Название документа
  • Метка объекта
  • Внутреннее имя объекта
  • Имя субэлемента объекта
  • Тип объекта


Sector 1: Document

FCInfo Document

(you can checked to false the variable switch_setVisible_GBox_001_Document for hidden the Box)

Сектор 2: Координаты щелкают мышью

  • Координаты X, Y и Z щелкают мышью
  • Кнопка создания в точке, оси, плоскости, копировать векторную ось формы FreeCAD.Vector (-24.0, 240.0, 7.0)

FCInfo Coordinate

(you can checked to false the variable switch_setVisible_GBox_002_Coordinate_Mouse for hidden the Box)

Sector 3: Color on point

FCInfo Color_on_point

Сектор 3: Ценность

  • Длина объекта, если объект отображается по периметру лица, можно выбрать размер единицы измерения:
    km, hm, dam, m, dm, cm, mm, µm, nm, pm, fm, inch, link, foot, yard, perch, chain, furlong, mile, league, nautique. Если объект является кругом, то одна секунда lineEdit открыта и отображает радиус круга.
  • Периметр формы

Sector 4: Components Mesh

FCInfo Component Mesh

If the selection is a mesh object one new window "Components" is displayed and gives:

(you can checked to false the variable switch_setVisible_GBox_004_Object_Mesh for hidden the Box)

Sector 5: Units

FCInfo Units

(you can checked to false the variable switch_setVisible_GBox_005_Value_Unit for hidden the Box)

Sector 6: Inclination

FCInfo Inclination

(you can checked to false the variable switch_setVisible_GBox_006_Inclination for hidden the Box)

Sector 7: Surface and Volume

FCInfo Surface and Volume

(you can checked to false the variable switch_setVisible_GBox_007_Surface_and_Volume for hidden the Box)

Sector 8: Cost

FCInfo Cost

0.027 Eu

10,0000 Eu (by Kg)
(you can checked to false the variable switch_setVisible_GBox_008_Cost_And_Price for hidden the Box)

Sector 9: BoundBox

FCInfo BoundBox

(you can checked to false the variable switch_setVisible_GBox_009_BoundBox for hidden the Box)

Sector 10: Center of:

FCInfo Center of...

(you can checked to false the variable switch_setVisible_GBox_010_Center_Mass for hidden the Box)

Sector 11: Inertia

FCInfo Inertia

same for length and weigth

(you can checked to false the variable switch_setVisible_GBox_011_Inertia for hidden the Box)

Sector 12: SpreadSheet

FCInfo Disabled

(you can checked to false the variable switch_setVisible_GBox_012_SpreadSheet for hidden the Box)

Sector 13: SpreadSheet creation

FCInfo SpreedSheet

Возможность сохранить или прочитать электронную таблицу с другим разделителем, табуляцией, запятой, точкой с запятой, пробелом
Табуляция является разделителем для модуля электронных таблиц FreeCAD.
Число этих четырех разделителей рассчитывается для справки, если неизвестно
COMMA - это старый (01.16 и ранее) разделитель макроса FCInfo
Теперь для совместимости с таблицей FreeCAD и начиная с версии 01.17 TABULATION является разделителем по умолчанию.
Если вы хотите преобразовать свою старую электронную таблицу FCInfo: откройте ее в FCInfo и сохраните ее, выбрав опцию Tabulation

Sector 14: Main tools

FCInfo Main

(you can checked to false the variable switch_setVisible_GBox_014_Main_Tools for hidden the Box)

После запуска макроса макрос остается активным, а окно остается видимым. Чтобы выйти из макроса, нажмите Exit. Если вы уйдете крестиком, макрос останется в памяти, а данные появятся в "представлении отчета" FreeCAD.

Options

Варианты

Используемая единица

Единица длины:

km, hm, dam, m, dm, cm, mm, µm, nm, pm, fm, inch, link, foot, yard, perch, chain, furlong, mile, league, nautique.

Length unit:

km, hm, dam, m, dm, cm, mm, µm, nm, pm, fm, inch, link, foot, yard, perch, chain, furlong, mile, league, nautique.

Angle degrees :

Угол градусов :

  1. decimal degree, ex: 174.831872611°
  2. degree minute seconde, ex: 174° 49' 54.741401''
  3. radian, ex: 3.05139181449 rad
  4. grade, ex: 194.257636235 gon
  5. pourcent ex: 30° = 57.74%

Понимание углов в дисплее FCInfo.

Weight unit :

Единица измерения веса :

ton, quintal, kg, hg, dag, gram, dg, cg, mg, µg, ng, pg, fg, gr (grain), dr (drachm), oz (once), oz t (once troy),
lb t (livre troy), lb (livre av), st (stone), qtr (quarter), cwt (hundredweight), tonneau fr, ct

the "spinBox" is set to 7,5 kg, средняя плотность стали. Если вы хотите другое значение по умолчанию, измените значение плотности, линии 208

FCInfo Configuration


This switch (section GroupBox) allows you to view only the desired section(s) (just visual) false or true.

All calculations are done without taking account of this option

скрипт

Скопируйте содержимое макроса в файл с именем "FCInfo.FCMacro"

  • Windows: the form is usually " drive:\Users\your_user_name\AppData\Roaming\FreeCAD\ "
  • Ubuntu: the form is usually " /home/your_user_name/.FreeCAD ".

Или прямо в интерфейсе FreeCAD
Значок должен находиться в том же каталоге, что и макрос.
Загрузите расположение изображения на иконке а затем перетащите мышкой правой кнопкой мыши «сохранить как» (не меняйте название)

Copy the contents of the macro in a file named "FCInfo.FCMacro"

Or, directly in the interface of FreeCAD
The icon must be in the same directory as the macro.
Download image positioning on the icon and then drag the mouse right click "save as" (do not change the name)

PS: слишком долго, чтобы содержаться на вики-странице (в настоящее время вики-страницы принимают только 64 КБ), код макроса размещен на форуме

Загрузите файл макроса в gist docked to right

(Или На форуме.)

PS: этот макрос использует getSelection (), и список объектов начинается с 1 ex: для блока Edge1 to Edge12 и код в консоли начинается с 0 ex: для поля Edge [0] to Edge[11]
Это нормально, когда подсчет массивов/списков внутри OpenCascade всегда начинается с 1, а не с 0

Limitations

Ограничения

Всегда оставляйте кнопку Exit. Если выйти из программы, не нажимая кнопку Exit, программа останется в памяти и продолжит работу, а дисплей останется в «отчете о просмотре». Вы должны оставить FreeCAD, чтобы стереть его из памяти.
В таблице видны только первые 200 элементов объекта, если в объекте более 200 элементов, сигнал будет отображаться как (! +200). Полный список данных отображается в файле, сохраненном кнопкой Save.

Если макрос окна не виден после запуска, см. Нижнее окно:


проект:
читает файл прямо в таблице. готово
соответствует "краям" и их координатам выполнено
Ассоциация вещества по его плотности
наклон элемента, а не глобального объекта готово
вставка прямо в интерфейс FreeCAD выполнена

Version

ver "1.30c" 2025/01/28 : replace connect comboBox for Arch Linux

replace:

QtCore.QObject.connect(self.comboBox_Unit, QtCore.SIGNAL(u"currentIndexChanged(QString)"), self.SIGNAL_comboPoids_Changed)

by:

self.comboBox_Unit.currentTextChanged.connect(self.SIGNAL_comboPoids_Changed)

ver "1.30b" 2025/01/20 : replace the slash Windows "\" by the slash Python "/"

ver "1.30" 2025/01/02 : delete all reference to PySide PySide2 and QtWidgets modify the (Qt) Save file

#
import PySide2
from PySide2 import QtGui , QtCore, QtWidgets
from PySide2.QtWidgets import QComboBox
from PySide2.QtWidgets import QMessageBox
from PySide2.QtWidgets import QTableWidget, QApplication
from PySide2.QtGui import *
from PySide2.QtCore import *
from PySide2.QtWidgets import *

            OpenName, Filter = PySide2.QtWidgets.QFileDialog.getOpenFileName(None, u"Read a txt file", setPathLatestDirectory, "*.FCInfo *.csv *.asc *.txt;;FCInfo (*.FCInfo);;Cvs (*.csv);;Ascii (*.asc);;TXT (*.txt);;(*.*);;(*)")#PySide2

replaced and change command by

#
import PySide
try:
    from PySide import QtWidgets
    from PySide.QtWidgets import *
except Exception:
    None
from PySide import QtGui , QtCore
from PySide.QtGui import *
from PySide.QtCore import *

            OpenName, Filter = QFileDialog.getOpenFileName(None, u"Read a txt file", setPathLatestDirectory, "*.FCInfo *.csv *.asc *.txt;;FCInfo (*.FCInfo);;Cvs (*.csv);;Ascii (*.asc);;TXT (*.txt);;(*.*);;(*)")#PySide

ver "1.29b" 2024/05/10 PySide2 modify Inertia " MatrixX1*uniteM to (MatrixX1*uniteM) " and adding spinBox inertia

ver 1.29 2024/05/06 french version fr PySide6 by sylvainbx https://gist.github.com/sylvainbx/af09a30be3e1427de56305825331fb29 merci sylvainbx

ver 1.28b 1.28c 2023/10/30 orthographe

ver 1.28 01/09/2023 modify variable name, possibility hidden each sector, save data spreadSheet in document, surface radius, add button webWiki and webForum

ver 1.27 2023/06/30 optimize the styleSheet, correct the left/right position and restore view after edition sketcher

self.PB_00_Decrement.setStyleSheet("background-color: white; border:2px solid rgb(215, 10, 22);")      # bord white and red

replaced by

self.PB_00_Decrement.setStyleSheet("QPushButton {background-color: white; border:2px solid rgb(215, 10, 22)};")      # bord white and red
  • ver 1.22 , 12/11/2020 : now the macro is totally uninstalled i use :

Adding

FreeCAD.ActiveDocument.openTransaction(u"FCInfo")    # memorise les actions (avec annuler restore)
FreeCAD.ActiveDocument.commitTransaction()           # restore les actions  (avec annuler restore)
#FreeCAD.ActiveDocument.abortTransaction()            # abandonne les actions(avec annuler restore)
try:
        self.window.setAttribute(QtCore.Qt.WA_DeleteOnClose, True)    # destroy
        self.window.deleteLater()                                     # destroy
        self.window.destroy()                                         # destroy
except Exception:
        None

How do i exit from FreeCAD instead of Python?

instead:

self.window.hide()

and i adding the possibility display or not the "Error Message" window "False" by default, if you wand activate the warning window go to :

FreeCAD >Menu >Tools >Edit parameters... >BaseApp/Preferences/Macros/FCMmacros/FCInfo > switchWarning
  • ver 1.21-3.01 , 07/11/2019 # 07/11/2019 ver "01.21-3-rmu" replace character micro = "U", square = "2", cube = "3", degrees = " deg" see "https://forum.freecadweb.org/viewtopic.php?f=3&t=6005&start=70#p345819"
  • ver 1.21.01 (1.21-rmu) 30/05/2019 rmu change fixed positions to qt layouts grid.addWidget() by rmu75 see the rmu75 fork "https://gist.github.com/rmu75/b165147bd1c2f2659c014103793ae1d8"
  • ver 1.20 , 29/01/2018 optimization
  • ver 1.19 , 20/01/2018 create checkBox for use detection all elements of the object if wanted or not , the macro is faster. Optimisation
  • ver 1.18 , 19/12/2017 ...
  • ver 1.17c , 14/12/2017 create plane with coordinate give in one project in other project and replace "FCInfo" by "__title__"
  • ver 1.17b , 13/12/2017 little correction replace FCTreeView to FCInfo
  • ver 1.17 , 12/12/2017 add upgrade Moment of inertia mm and kg by pinq FCMacro and moment of inertia of assembly, and create plane, axis, point, and add options separator for spreadsheet
  • ver 1.16 , 21/06/2017 add control height police (here PointSize 8) and checkbox for position the window to right or left
  • ver 1.15 , 19/12/2015 suppression PyQt4 option see , add checkBox for editing infos in report view
  • ver 1.14 , 04/08/2014 replace PyQt4 and PySide and correct tooltip not displayed cause on PySide and add fg
  • ver 1.13 , 27/07/2014 replace FCInfo_en_Ver_1-12_Docked.FCMacro to FCInfo_en_Ver_1-13_Docked.FCMacro accept PyQt4 and PySide
  • ver 1.12 , 10/03/2014 adding tooltip
  • ver 1.11 , 04/03/2014 adding µm, nm, pm, fm, µg, ng, pg, pourcent, fixed of grandeur carat "cd" in "ct", display of the label and internal name, fixed calculation of angles XY YZ ZX could give an error on a compound shape, window dockable in FreeCAD
  • ver 1.10b , 19/11/2013 buttons outside the scrollbar and the dimensions of the window blocking
  • ver 1.10 , 18/11/2013 create scrollbar
  • ver 1.08b , 10/11/2013 translation units in English, error correction to display the area of the faces listed in the table and replacement of the"print" by "App.Console.PrintMessage"
  • ver 1.09 , 04/11/2013 works perfectly on Windows and Linux (cause of errors on Linux the characters : ² ³ ° "ordinal not in range(128)")
  • ver 1.08 , 24/10/2013 correction of high top "Faces" and "Edges" displaying 100 objects (in the saved file)
  • ver 1.07 , 11/10/2013 matches the "Faces" and their coordinates.
  • ver 1.06 , 22/09/2013 matches the "Edges" and their coordinates, inclination on the element rather than the global object
  • ver 1.05 , 17/09/2013 added an icon for the spreadsheet, conversion barrel fr, affichage des dimensions overall instead of coordinates.
  • ver 1.04 , 11/09/2013: read the file directly in a table.
  • ver 1.03 , 09/09/2013: clearer display in view report and replacement by "typeObject = sel[0].Shape.ShapeType"
  • ver 1.02 , 7/09/2013 : small updates
  • ver 1.00 , 6/09/2013

Ссылки

Смотрите также: Arch Survey Arch Survey

Вы можете поделиться своими комментариями на форуме Info Workbench - Help with icons please.
Здесь еще один пост FCInfo Macro